//
//  HomeLanguageCell.swift
//  
//
//  Created by CSS on 8/17/23.
//

import UIKit

class HomeLanguageCell: UICollectionViewCell {

    private static let templateLbl: UILabel = {
        let templateLbl = UILabel()
        templateLbl.font = .systemFont(ofSize: 18)
        return templateLbl
    }()
    
    @IBOutlet private weak var languageNameLbl: UILabel!
    
    var languageType: LanguageType = .chinese {
        didSet {
            languageNameLbl.text = languageType.languageName
        }
    }
    
    override func awakeFromNib() {
        super.awakeFromNib()
    }
    
    class func cellSize(withValue value: String) -> CGSize {
        templateLbl.text = value
        return .init(width: templateLbl.intrinsicContentSize.width + 12, height: 35)
    }

}
